<template>
        	<div v-if="token">
        		<span class="bluespan" @click="work">{{username}}（套餐剩余<span>{{remaindays}}</span>天）</span>
        		<span class="bluespan" @click="pay">充值</span>
        		<span class="bluespan" @click="esc">退出</span>
        	</div>            
</template>

<script>
		import axios from 'axios'

	export default {
		name: 'HeadInfo',
		data(){
			return{
				}
		},
		props:['token','username','remaindays'],
		computed:{
			// token(){
			// 	return this.$store.state.token   
			// },
	        // username(){	        	
	        //   	return this.$store.state.username       	
	        // },
	        // remain_days(){
	        // 	return this.$store.state.remain_days
	        // }	  
	    },
		methods:{
			pay(){
	          this.$router.push({name: 'UserPay'})
	        },
	        work(){
	        	this.$router.push({name: 'UserWork'})
	        },
	        esc(){
	        	this.$store.dispatch('reset')
	        	axios.post('/login/logout')
	        		.then((res)=>{
	        			this.$emit('func')
	        			
	        	})			    
	        }
		},
		 mounted () {
      		
    	}
	}
</script>

<style scoped >


.headlogo span{
	margin-top: 2px;
}
.bluespan{
	font-size: 11px;
	margin-left:10px;
	background: #1e49d1;
	padding:5px 10px;
	border-radius: 10px;
	cursor: pointer;
}

</style>